package com.hrt.bean;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/** 礼品分类目录GiftType
 */
@Entity
@Table(name = "gift_type")
@JsonIgnoreProperties(value = {"giftType"})
public class GiftType implements Serializable {

	private static final long serialVersionUID = 1L;
	
	/** 礼品分类主键ID
	 * */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "TYPE_ID")
	private Long id;
	
	//optional的值 true可以为空；false不可以为空
	/**礼品分类自关联*/
	@ManyToOne(cascade = {CascadeType.REFRESH, CascadeType.MERGE}, optional = true)
	@JoinColumn(name = "TYPE_PARETID")
	private GiftType giftType;
	
	/**礼品分类自关联ID*/
	@Column(name = "TYPE_PARETID",insertable=false,updatable=false)
	private Long parentId;
	
	/** 分类代码
	 * */
	@Column(name = "TYPE_CODE",length = 500)
	private String typeCode;
	
	/** 分类名称 
	 * */
	@Column(name = "TYPE_NAME",length = 500)
	private String typeName;
	
	/** 说明
	 * */
	@Column(name = "TYPE_DESCRIPTION",length = 500)
	private String description;
	
	/**备注 
	 * */
	@Column(name = "TYPE_NOTE",length = 500)
	private String note;
	
	/**
	 * 删除标记 0未删除 1已删除
	 */
	@Column(name = "ISDELETE", length = 500)
	private Integer isdelete = 0;
	
	@Transient
	List<GiftType> sonType;
	
	/**
	 * get() / set()
	 * */
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public String getTypeCode() {
		return typeCode;
	}
	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}
	
	public String getTypeName() {
		return typeName;
	}
	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}
	
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	
	public Integer getIsdelete() {
		return isdelete;
	}
	public void setIsdelete(Integer isdelete) {
		this.isdelete = isdelete;
	}
	
	/**自关联*/
	public GiftType getGiftType() {
		return giftType;
	}
	public void setGiftType(GiftType giftType) {
		this.giftType = giftType;
	}
	
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
	
	public List<GiftType> getSonType() {
		return sonType;
	}
	public void setSonType(List<GiftType> sonType) {
		this.sonType = sonType;
	}
	   
	
}
